﻿namespace Sidvall.WorkItemManager.Model
{
    public sealed partial class GenericDataPortal : global::Sidvall.WorkItemManager.Model.DataPortalBase
    {
        #region Public Members

        #region WorkConditionManager

        private global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkConditionManager<global::Sidvall.WorkItemManager.Data.IWorkCondition, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkCondition>> _WorkConditionManager;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
        public global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkConditionManager<global::Sidvall.WorkItemManager.Data.IWorkCondition, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkCondition>> WorkConditionManager
        {
            get
            {
                return _WorkConditionManager;
            }
            private set
            {
                _WorkConditionManager = value;
            }
        }

        #endregion
        #region WorkerManager

        private global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkerManager<global::Sidvall.WorkItemManager.Data.IWorker, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorker>> _WorkerManager;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
        public global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkerManager<global::Sidvall.WorkItemManager.Data.IWorker, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorker>> WorkerManager
        {
            get
            {
                return _WorkerManager;
            }
            private set
            {
                _WorkerManager = value;
            }
        }

        #endregion
        #region WorkItemManager

        private global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemManager<global::Sidvall.WorkItemManager.Data.IWorkItem, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItem>> _WorkItemManager;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
        public global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemManager<global::Sidvall.WorkItemManager.Data.IWorkItem, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItem>> WorkItemManager
        {
            get
            {
                return _WorkItemManager;
            }
            private set
            {
                _WorkItemManager = value;
            }
        }

        #endregion
        #region WorkItemLogManager

        private global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemLogManager<global::Sidvall.WorkItemManager.Data.IWorkItemLog, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemLog>> _WorkItemLogManager;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
        public global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemLogManager<global::Sidvall.WorkItemManager.Data.IWorkItemLog, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemLog>> WorkItemLogManager
        {
            get
            {
                return _WorkItemLogManager;
            }
            private set
            {
                _WorkItemLogManager = value;
            }
        }

        #endregion
        #region WorkItemSensorManager

        private global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemSensorManager<global::Sidvall.WorkItemManager.Data.IWorkItemSensor, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemSensor>> _WorkItemSensorManager;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
        public global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemSensorManager<global::Sidvall.WorkItemManager.Data.IWorkItemSensor, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemSensor>> WorkItemSensorManager
        {
            get
            {
                return _WorkItemSensorManager;
            }
            private set
            {
                _WorkItemSensorManager = value;
            }
        }

        #endregion
        #region WorkItemSensorLogManager

        private global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemSensorLogManager<global::Sidvall.WorkItemManager.Data.IWorkItemSensorLog, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemSensorLog>> _WorkItemSensorLogManager;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
        public global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemSensorLogManager<global::Sidvall.WorkItemManager.Data.IWorkItemSensorLog, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemSensorLog>> WorkItemSensorLogManager
        {
            get
            {
                return _WorkItemSensorLogManager;
            }
            private set
            {
                _WorkItemSensorLogManager = value;
            }
        }

        #endregion
        #region WorkItemTypeManager

        private global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemTypeManager<global::Sidvall.WorkItemManager.Data.IWorkItemType, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemType>> _WorkItemTypeManager;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
        public global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemTypeManager<global::Sidvall.WorkItemManager.Data.IWorkItemType, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemType>> WorkItemTypeManager
        {
            get
            {
                return _WorkItemTypeManager;
            }
            private set
            {
                _WorkItemTypeManager = value;
            }
        }

        #endregion
        #region WorkItemWorkConditionManager

        private global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemWorkConditionManager<global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition>> _WorkItemWorkConditionManager;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
        public global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemWorkConditionManager<global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition>> WorkItemWorkConditionManager
        {
            get
            {
                return _WorkItemWorkConditionManager;
            }
            private set
            {
                _WorkItemWorkConditionManager = value;
            }
        }

        #endregion
        #region WorkRetryPolicyManager

        private global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkRetryPolicyManager<global::Sidvall.WorkItemManager.Data.IWorkRetryPolicy, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkRetryPolicy>> _WorkRetryPolicyManager;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
        public global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkRetryPolicyManager<global::Sidvall.WorkItemManager.Data.IWorkRetryPolicy, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkRetryPolicy>> WorkRetryPolicyManager
        {
            get
            {
                return _WorkRetryPolicyManager;
            }
            private set
            {
                _WorkRetryPolicyManager = value;
            }
        }

        #endregion
        
        #endregion
        #region Private Members

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")]
        private void Init(bool alwaysUseLocalDataPortal)
        {
            this.WorkConditionManager = new global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkConditionManager<global::Sidvall.WorkItemManager.Data.IWorkCondition, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkCondition>>(this, alwaysUseLocalDataPortal);
            this.WorkerManager = new global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkerManager<global::Sidvall.WorkItemManager.Data.IWorker, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorker>>(this, alwaysUseLocalDataPortal);
            this.WorkItemManager = new global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemManager<global::Sidvall.WorkItemManager.Data.IWorkItem, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItem>>(this, alwaysUseLocalDataPortal);
            this.WorkItemLogManager = new global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemLogManager<global::Sidvall.WorkItemManager.Data.IWorkItemLog, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemLog>>(this, alwaysUseLocalDataPortal);
            this.WorkItemSensorManager = new global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemSensorManager<global::Sidvall.WorkItemManager.Data.IWorkItemSensor, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemSensor>>(this, alwaysUseLocalDataPortal);
            this.WorkItemSensorLogManager = new global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemSensorLogManager<global::Sidvall.WorkItemManager.Data.IWorkItemSensorLog, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemSensorLog>>(this, alwaysUseLocalDataPortal);
            this.WorkItemTypeManager = new global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemTypeManager<global::Sidvall.WorkItemManager.Data.IWorkItemType, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemType>>(this, alwaysUseLocalDataPortal);
            this.WorkItemWorkConditionManager = new global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkItemWorkConditionManager<global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkItemWorkCondition>>(this, alwaysUseLocalDataPortal);
            this.WorkRetryPolicyManager = new global::Sidvall.WorkItemManager.Model.DataPortalManagers.WorkRetryPolicyManager<global::Sidvall.WorkItemManager.Data.IWorkRetryPolicy, Sidvall.Data.IDataRowProvider<global::Sidvall.WorkItemManager.Data.IWorkRetryPolicy>>(this, alwaysUseLocalDataPortal);
        }

        #endregion
        #region Constructors

        public GenericDataPortal(global::Sidvall.WorkItemManager.Model.IDataPortalManager dataPortalManager, bool alwaysUseLocalDataPortal)
            : base(dataPortalManager)
        {
            Init(alwaysUseLocalDataPortal);
        }
        public GenericDataPortal(global::Sidvall.Business.IDataPortal dataPortal, global::Sidvall.Data.IResourceFactory resourceFactory)
            : base(resourceFactory, dataPortal)
        {
            Init(true);
        }

        #endregion
    }
}